<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第六章首页</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<h1>第六章首页</h1>
<p>欢迎来到第六章的首页！</p>
<button onclick="headerTest()">请求头传值测试 默认不能传递中文参数</button>
<script>
    function headerTest() {
        //使用jQuery的ajax方法发送一个GET请求，请求路径为/http://127.0.0.1:9010/feign/api/order/header，在请求头上添加两个参数:name=张三,address=北京
        $.ajax({
            url: "http://127.0.0.1:9010/feign/api/order/header",
            type: "GET",
            headers: {
                "name": "zhangsan",
                "address": "beijing"
            },
            success: function (data) {
                alert(data);
            },
            error: function (xhr, status, error) {
                console.log(xhr.status + " " + xhr.statusText + " " + error);
            }
        });
    }

</script>
</body>
</html>